fix(web): normalize backend API URL and accept legacy search response…#201
Conversation
|
@madmansn0w is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
reversTeam
left a comment
There was a problem hiding this comment.
Small and focused fix. The buildBackendApiUrl helper correctly normalizes the backend URL regardless of whether the user provides http://host:3000 or http://host:3000/api.
The logic is straightforward:
- Strip trailing slashes from the base URL.
- Ensure the endpoint path starts with
/. - If the base already ends with
/api, append the path directly; otherwise, insert/api.
This prevents the /api/api/... double-prefix issue that would occur when users configure a URL already containing the /api segment.
Note: This diff is a subset of #202 (which includes additional changes). If #202 lands first, this PR may become redundant or conflict-free. Worth coordinating the merge order.
LGTM.
|
Addressed in #202 - thanks for catching that. |
|
|
Please submit a new PR if this is still relevant |
Summary
Fix backend-mode agent failures in
gitnexus-webcaused by API URL and response-shape mismatches.What this fixes
Double
/apipath bug.../api./api/...again, producing.../api/api/queryand.../api/api/search.Legacy
/api/searchresponse compatibility{ results: [...] }) instead of grouped shape (process_symbols,definitions).File changed
gitnexus-web/src/workers/ingestion.worker.tsValidation
crank,crank-control,mentat) and confirmed non-empty graph/query results.npm run buildingitnexus-web).http://localhost:4747http://localhost:4747/apiImpact